package com.boot.mongodb.service;

import com.boot.mongodb.dao.UserDao;
import com.boot.mongodb.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class UserService {

    @Autowired
    private UserDao userDao;

    public void saveUser(User user) {
        this.userDao.save(user);
    }

    public User getUser(String id) {
        return this.userDao.getUser(id);
    }

    public List<User> getUsers() {
        return this.userDao.getUsers();
    }

    public List<User> getUserForPage(int pageNum, int pageSize) {
        return this.userDao.getUserForPage(pageNum, pageSize);
    }
}
